//
//  UINavigationBar+ADUtil.m
//  ADKit
//
//  Created by adu on 2018/6/24.
//

#import "UINavigationBar+ADUtil.h"
#import <objc/runtime.h>

static char AD_UINavigationBar_LeftNavigationBarImage_Key;
static char AD_UINavigationBar_RightNavigationBarImage_Key;

@implementation UINavigationBar (ADUtil)

+ (void)setLeftNavigationBarImage:(UIImage *)leftNavigationBarImage {
    objc_setAssociatedObject(self, &AD_UINavigationBar_LeftNavigationBarImage_Key, leftNavigationBarImage, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

+ (UIImage *)leftNavigationBarImage {
    return objc_getAssociatedObject(self, &AD_UINavigationBar_LeftNavigationBarImage_Key);
}

+ (void)setRightNavigationBarImage:(UIImage *)rightNavigationBarImage {
    objc_setAssociatedObject(self, &AD_UINavigationBar_RightNavigationBarImage_Key, rightNavigationBarImage, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

+ (UIImage *)rightNavigationBarImage {
    return objc_getAssociatedObject(self, &AD_UINavigationBar_RightNavigationBarImage_Key);
}

@end
